//
//  CLTabPagerBarLayout.h
//  Charles
//
//  Created by Leo on 2019/4/25.
//  Copyright © 2019 charles. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CLTabPagerBarCell.h"

NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, CLTabPagerBarStyle) {
    CLTabPagerBarStyleNoneView,
    CLTabPagerBarStyleProgressView,
    CLTabPagerBarStyleProgressBounceView,
    CLTabPagerBarStyleProgressElasticView,
    CLTabPagerBarStyleCoverView,
};
@class CLTabPagerBar;
/**
 分段页面Bar样式布局
 */
@interface CLTabPagerBarLayout : NSObject

@property (nonatomic, weak, readonly) CLTabPagerBar *pagerTabBar;
@property (nonatomic, assign, readonly) CGFloat selectFontScale;
@property (nonatomic, assign) CLTabPagerBarStyle barStyle;
@property (nonatomic, assign) UIEdgeInsets sectionInset;

@property (nonatomic, assign) CGFloat progressHeight;
@property (nonatomic, assign) CGFloat progressWidth;
@property (nonatomic, strong, nullable) UIColor *progressColor;
@property (nonatomic, assign) CGFloat progressRadius;
@property (nonatomic, assign) CGFloat progressBorderWidth;
@property (nonatomic, strong, nullable) UIColor *progressBorderColor;
@property (nonatomic, assign) CGFloat progressHorEdging;
@property (nonatomic, assign) CGFloat progressVerEdging;

@property (nonatomic, assign) CGFloat cellWidth;
@property (nonatomic, assign) CGFloat cellSpacing;
@property (nonatomic, assign) CGFloat cellEdging;
@property (nonatomic, assign) BOOL adjustContentCellsCenter;

@property (nonatomic, strong) UIFont *normalTextFont;
@property (nonatomic, strong) UIFont *selectedTextFont;
@property (nonatomic, strong) UIColor *normalTextColor;
@property (nonatomic, strong) UIColor *selectedTextColor;
@property (nonatomic, assign) BOOL textColorProgressEnable;

@property (nonatomic, assign) CGFloat animateDuration;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

- (instancetype)initWithPagerTabBar:(CLTabPagerBar *)pagerTabBar NS_DESIGNATED_INITIALIZER;

- (void)layoutIfNeed;

- (void)invalidateLayout;

- (void)layoutSubViews;

- (void)adjustContentCellsCenterInBar;

- (void)transitionFromCell:(UICollectionViewCell <CLTabPagerBarCellProtocol> *_Nullable) fromCell toCell:(UICollectionViewCell <CLTabPagerBarCellProtocol> *_Nullable)toCell animated:(BOOL)animated;

- (void)transitionFromCell:(UICollectionViewCell <CLTabPagerBarCellProtocol> *_Nullable) fromCell toCell:(UICollectionViewCell <CLTabPagerBarCellProtocol> *_Nullable)toCell progress:(CGFloat)progress;

- (void)setUnderLineFrameWithIndex:(NSInteger)index animated:(BOOL)animated;

- (void)setUnderLineFrameWithFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex progress:(CGFloat)progress;

@end

NS_ASSUME_NONNULL_END
